SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:		Eduardo Murillo
-- Create date: 06/12/2011
-- Description:	Devuelve un aula segun su id
-- =============================================
CREATE PROCEDURE [dbo].[usp_AULA_GetAulaById]
	@intAulaId	int
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;
	
	SELECT [aulaId]
      ,[nombreAula]
      ,[estado]
	FROM [SCHOOL].[dbo].[tbl_Aula]
	WHERE [aulaId]=@intAulaId

END
GO






SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:		Eduardo Murillo
-- Create date: 06/12/2011
-- Description:	Devuelve las aulas segun la busqueda
-- =============================================
CREATE PROCEDURE [dbo].[usp_AULA_GetAulaBySearch]
	@varSearchTerm	VARCHAR(4000)
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

   SELECT [aulaId]
      ,[nombreAula]
      ,[estado]
	FROM [SCHOOL].[dbo].[tbl_Aula]
	WHERE [nombreAula] LIKE '%' + @varSearchTerm + '%'
END
GO







SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:		Eduardo Murillo
-- Create date: 06/12/2011
-- Description:	Devuelve las actividades segun la busqueda
-- =============================================
CREATE PROCEDURE [dbo].[usp_ACTIVIDAD_GetActividadeBySearch]
	@varSearchTerm	VARCHAR(4000)
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

    SELECT [actividadId]
      ,[nombre]
      ,[descripcion]
      ,[fecha]
      ,[cursoXGestionId]
	FROM [SCHOOL].[dbo].[tbl_Actividad]
	WHERE [nombre] LIKE '%'+@varSearchTerm+'%' 
	OR [descripcion] LIKE '%'+@varSearchTerm+'%'

END
GO







SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:		Eduardo Murillo
-- Create date: 06/12/2011
-- Description:	Devuelve las actividades segun su Id
-- =============================================
CREATE PROCEDURE [dbo].[usp_ACTIVIDAD_GetActividadeById]
	@varId	int
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

    SELECT [actividadId]
      ,[nombre]
      ,[descripcion]
      ,[fecha]
      ,[cursoXGestionId]
	FROM [SCHOOL].[dbo].[tbl_Actividad]
	WHERE [actividadId]=@varId

END
GO





SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:		Eduardo Murillo
-- Create date: 06/12/2011
-- Description:	Devuelve las Becas segun su Id
-- =============================================
CREATE PROCEDURE [dbo].[usp_BECA_GetBecaById]
	@varId	int
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

   SELECT [becaId]
      ,[nombre]
      ,[porcentajeDescuento]
	FROM [SCHOOL].[dbo].[tbl_Beca]
	WHERE [becaId]=@varId

END
GO






SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:		Eduardo Murillo
-- Create date: 06/12/2011
-- Description:	Devuelve las Becas segun su Busqueda
-- =============================================
CREATE PROCEDURE [dbo].[usp_BECA_GetBecaBySearch]
	@varSearchTerm	VARCHAR(4000)
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

   SELECT [becaId]
      ,[nombre]
      ,[porcentajeDescuento]
	FROM [SCHOOL].[dbo].[tbl_Beca]
	WHERE [nombre] LIKE '%'+@varSearchTerm+'%'

END
GO






SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:		Eduardo Murillo
-- Create date: 06/12/2011
-- Description:	Devuelve los cursos segun su Busqueda
-- =============================================
CREATE PROCEDURE [dbo].[usp_CURSO_GetCursoBySearch]
	@varSearchTerm	VARCHAR(4000)
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;
	
	SELECT [cursoId]
      ,[nombreCurso]
      ,[nivel]
	FROM [SCHOOL].[dbo].[tbl_Curso]
	WHERE [nombreCurso] LIKE '%' + @varSearchTerm + '%' 
	OR [nivel] LIKE '%' + @varSearchTerm + '%'


END
GO





SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:		Eduardo Murillo
-- Create date: 06/12/2011
-- Description:	Devuelve los cursos segun su Id
-- =============================================
CREATE PROCEDURE [dbo].[usp_CURSO_GetCursoById]
	@varId int
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;
	
	SELECT [cursoId]
      ,[nombreCurso]
      ,[nivel]
	FROM [SCHOOL].[dbo].[tbl_Curso]
	WHERE [cursoId]=@varId


END
GO






SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:		Eduardo Murillo
-- Create date: 06/12/2011
-- Description:	Devuelve las evaluaciones segun su Id
-- =============================================
CREATE PROCEDURE [dbo].[usp_EVALUACION_GetEvaluacionById]
	@varId int
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

    SELECT [evaluacionId]
      ,[nombreEvaluacion]
      ,[notaBase]
      ,[gestionId]
	FROM [SCHOOL].[dbo].[tbl_Evaluaciones]
	WHERE [evaluacionId]=@varId


END
GO





SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:		Eduardo Murillo
-- Create date: 06/12/2011
-- Description:	Devuelve las evaluaciones segun su Busqueda
-- =============================================
CREATE PROCEDURE [dbo].[usp_EVALUACION_GetEvaluacionBySearch]
	@varSearchTerm	VARCHAR(4000)
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

    SELECT [evaluacionId]
      ,[nombreEvaluacion]
      ,[notaBase]
      ,[gestionId]
	FROM [SCHOOL].[dbo].[tbl_Evaluaciones]
	WHERE [nombreEvaluacion] LIKE '%' + @varSearchTerm + '%' 
	OR [notaBase] LIKE '%' + @varSearchTerm + '%'


END
GO









SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:		Eduardo Murillo
-- Create date: 06/12/2011
-- Description:	Devuelve las materias segun su Busqueda
-- =============================================
CREATE PROCEDURE [dbo].[usp_MATERIA_GetMateriaBySearch]
	@varSearchTerm	VARCHAR(4000)
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

	SELECT [materiaId]
      ,[nombreMateria]
	FROM [SCHOOL].[dbo].[tbl_Materia]
	WHERE [nombreMateria] LIKE '%' + @varSearchTerm + '%' 

END
GO








SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
-- =============================================
-- Author:		Eduardo Murillo
-- Create date: 06/12/2011
-- Description:	Devuelve las materias segun su Id
-- =============================================
CREATE PROCEDURE [dbo].[usp_MATERIA_GetMateriaById]
	@varId int
AS
BEGIN
	-- SET NOCOUNT ON added to prevent extra result sets from
	-- interfering with SELECT statements.
	SET NOCOUNT ON;

	SELECT [materiaId]
      ,[nombreMateria]
	FROM [SCHOOL].[dbo].[tbl_Materia]
	WHERE [materiaId]=@varId

END
GO
